%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/interfaces-via-union-all/vulnerabilitiesConnection.before1.variables"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 8, 12, 13, 15, 28, 56, 14, 17<br />2: PgUnionAll[11]<br />ᐳ: Access[23]<br />3: Connection[16]<br />4: ConnectionItems[18]"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 16, 23, 28, 18, 14<br /><br />ROOT Connectionᐸ11ᐳ[16]"):::bucket
    Bucket3("Bucket 3 (listItem)<br />Deps: 23, 28, 14<br /><br />ROOT __Item{3}ᐸ18ᐳ[21]"):::bucket
    Bucket4("Bucket 4 (nullableBoundary)<br />Deps: 30, 22, 14, 32, 24<br /><br />ROOT Edge{3}[22]"):::bucket
    Bucket5("Bucket 5 (polymorphic)<br />__typename: Access[31]<br />Deps: 31, 14, 32"):::bucket
    Bucket6("Bucket 6 (polymorphicPartition)<br />|FirstPartyVulnerability<br />Deps: 14, 32<br />ᐳFirstPartyVulnerability<br /><br />1: PgSelect[33]<br />2: PgSelectRows[38]<br />ᐳ: 37, 39, 48, 50, 52, 54"):::bucket
    Bucket7("Bucket 7 (polymorphicPartition)<br />|ThirdPartyVulnerability<br />Deps: 14, 32<br />ᐳThirdPartyVulnerability<br /><br />1: PgSelect[41]<br />2: PgSelectRows[46]<br />ᐳ: 45, 47, 49, 51, 53, 55"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket3
    Bucket3 --> Bucket4
    Bucket4 --> Bucket5
    Bucket5 --> Bucket6 & Bucket7

    %% plan dependencies
    PgUnionAll11[["PgUnionAll[11∈0] ➊<br />ᐸFirstPartyVulnerability,ThirdPartyVulnerabilityᐳ<br />More deps:<br />- Object[14]<br />- Constantᐸ[Function: applyInputConstant]ᐳ[15]<br />- Constantᐸ2ᐳ[56]"]]:::plan
    Lambda17{{"Lambda[17∈0] ➊<br />ᐸparseCursorᐳ"}}:::plan
    Lambda17 --> PgUnionAll11
    Connection16[["Connection[16∈0] ➊<br />ᐸ11ᐳ<br />More deps:<br />- Constantᐸ2ᐳ[56]"]]:::plan
    PgUnionAll11 & Lambda17 --> Connection16
    Object14{{"Object[14∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ<br />Dependents: 3"}}:::plan
    Access12{{"Access[12∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access13{{"Access[13∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access12 & Access13 --> Object14
    Access8{{"Access[8∈0] ➊<br />ᐸ0.valueᐳ"}}:::plan
    __Value0["__Value[0∈0] ➊<br />ᐸvariableValuesᐳ"]:::plan
    __Value0 --> Access8
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access12
    __Value2 --> Access13
    Access8 --> Lambda17
    ConnectionItems18[["ConnectionItems[18∈0] ➊"]]:::plan
    Connection16 --> ConnectionItems18
    Access23{{"Access[23∈0] ➊<br />ᐸ11.cursorDetailsᐳ"}}:::plan
    PgUnionAll11 --> Access23
    List29{{"List[29∈3]<br />ᐸ26,27,28ᐳ<br />More deps:<br />- Constantᐸ[HIDDEN]ᐳ[28]"}}:::plan
    Access26{{"Access[26∈3]<br />ᐸ21.0ᐳ"}}:::plan
    Access27{{"Access[27∈3]<br />ᐸ21.1ᐳ"}}:::plan
    Access26 & Access27 --> List29
    Edge22{{"Edge[22∈3]"}}:::plan
    __Item21[/"__Item[21∈3]<br />ᐸ18ᐳ"\]:::itemplan
    PgCursor24{{"PgCursor[24∈3]"}}:::plan
    __Item21 & PgCursor24 --> Edge22
    __Item21 & Access23 --> PgCursor24
    ConnectionItems18 ==> __Item21
    __Item21 --> Access26
    __Item21 --> Access27
    Lambda30{{"Lambda[30∈3]<br />ᐸtoSpecifierᐳ"}}:::plan
    List29 --> Lambda30
    Access32{{"Access[32∈3]<br />ᐸ30.idᐳ"}}:::plan
    Lambda30 --> Access32
    Access31{{"Access[31∈4]<br />ᐸ30.__typenameᐳ"}}:::plan
    Lambda30 --> Access31
    PgSelect33[["PgSelect[33∈6]<br />ᐸfirst_party_vulnerabilitiesᐳ<br />ᐳFirstPartyVulnerability<br />More deps:<br />- Object[14]"]]:::plan
    Access32 --> PgSelect33
    First37{{"First[37∈6]^"}}:::plan
    PgSelectRows38[["PgSelectRows[38∈6]^"]]:::plan
    PgSelectRows38 --> First37
    PgSelect33 --> PgSelectRows38
    PgSelectSingle39{{"PgSelectSingle[39∈6]^<br />ᐸfirst_party_vulnerabilitiesᐳ"}}:::plan
    First37 --> PgSelectSingle39
    PgClassExpression48{{"PgClassExpression[48∈6]^<br />ᐸ__first_pa...vss_score”ᐳ"}}:::plan
    PgSelectSingle39 --> PgClassExpression48
    PgClassExpression50{{"PgClassExpression[50∈6]^<br />ᐸ__first_pa...ies__.”id”ᐳ"}}:::plan
    PgClassExpression48 o--o PgClassExpression50
    PgClassExpression52{{"PgClassExpression[52∈6]^<br />ᐸ__first_pa...s__.”name”ᐳ"}}:::plan
    PgClassExpression50 o--o PgClassExpression52
    PgClassExpression54{{"PgClassExpression[54∈6]^<br />ᐸ__first_pa...team_name”ᐳ"}}:::plan
    PgClassExpression52 o--o PgClassExpression54
    PgSelect41[["PgSelect[41∈7]<br />ᐸthird_party_vulnerabilitiesᐳ<br />ᐳThirdPartyVulnerability<br />More deps:<br />- Object[14]"]]:::plan
    Access32 --> PgSelect41
    First45{{"First[45∈7]^"}}:::plan
    PgSelectRows46[["PgSelectRows[46∈7]^"]]:::plan
    PgSelectRows46 --> First45
    PgSelect41 --> PgSelectRows46
    PgSelectSingle47{{"PgSelectSingle[47∈7]^<br />ᐸthird_party_vulnerabilitiesᐳ"}}:::plan
    First45 --> PgSelectSingle47
    PgClassExpression49{{"PgClassExpression[49∈7]^<br />ᐸ__third_pa...vss_score”ᐳ"}}:::plan
    PgSelectSingle47 --> PgClassExpression49
    PgClassExpression51{{"PgClassExpression[51∈7]^<br />ᐸ__third_pa...ies__.”id”ᐳ"}}:::plan
    PgClassExpression49 o--o PgClassExpression51
    PgClassExpression53{{"PgClassExpression[53∈7]^<br />ᐸ__third_pa...s__.”name”ᐳ"}}:::plan
    PgClassExpression51 o--o PgClassExpression53
    PgClassExpression55{{"PgClassExpression[55∈7]^<br />ᐸ__third_pa...ndor_name”ᐳ"}}:::plan
    PgClassExpression53 o--o PgClassExpression55

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value0,__Value2,Access8,PgUnionAll11,Access12,Access13,Object14,Connection16,Lambda17,ConnectionItems18,Access23 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1 bucket1
    classDef bucket3 stroke:#ffa500
    class Bucket3,__Item21,Edge22,PgCursor24,Access26,Access27,List29,Lambda30,Access32 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4,Access31 bucket4
    classDef bucket5 stroke:#7fff00
    class Bucket5 bucket5
    classDef bucket6 stroke:#ff1493
    class Bucket6,PgSelect33,First37,PgSelectRows38,PgSelectSingle39,PgClassExpression48,PgClassExpression50,PgClassExpression52,PgClassExpression54 bucket6
    classDef bucket7 stroke:#808000
    class Bucket7,PgSelect41,First45,PgSelectRows46,PgSelectSingle47,PgClassExpression49,PgClassExpression51,PgClassExpression53,PgClassExpression55 bucket7

